# install product by installation script
ENV INTEL_OPENVINO_DIR /opt/intel/openvino

# hadolint ignore=DL3031, DL3033
RUN yum update -y && yum install -y cpio && \
    yum clean all && rm -rf /var/cache/yum && \
    tar -xzf ${TEMP_DIR}/*.tgz --strip 1 && \
    sed -i 's/decline/accept/g' silent.cfg && \
    ${TEMP_DIR}/install.sh -s silent.cfg && \
    OV_BUILD="$(find /opt/intel -maxdepth 1 -type d -name "*openvino*" | grep -oP '(?<=_)\d+.\d+.\d+')" && \
    ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino && rm -rf ${TEMP_DIR} && \
    rm -rf ${INTEL_OPENVINO_DIR}/tools/workbench
{% if no_samples is defined %}
RUN rm -rf ${INTEL_OPENVINO_DIR}/extras/open_model_zoo/demos && \
    rm -rf ${INTEL_OPENVINO_DIR}/samples
{% endif %}